import common from './common.js';
import dayjs from 'dayjs';
const Edit = {
	isJiess: true,
	name: 'Edit',
	setup({ midder, record, ...props }) {
		const { startDate, endDate, startTime, endTime } = record
		if (startDate && endDate) {
			const format = 'YYYY-MM-DD';
			record.startDate = dayjs(startDate, format);
			record.endDate = dayjs(endDate, format);
		}
		if (startTime && endTime) {
			const format = 'HH:mm';
			record.startTime = dayjs(startTime, format);
			record.endTime = dayjs(endTime, format);
		}
		common.call(this, midder, { type: 'edit', record, ...props });
	}
};
export default Edit;